package com.deepblue.image.maker.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @ClassName CommonResult
 * @Description
 * @Author yangxd
 * @Date 2021/8/19 13:47
 * @Version 1.0
 **/
@Data
@ApiModel
public class CommonResult<T> {
    /**
     * code
     */
    @ApiModelProperty(value = "返回码,10000标识成功;其他码标识失败", required = true)
    private String code;
    /**
     * msg
     */
    @ApiModelProperty(value = "返回码错误码描述", required = true)
    private String msg;
    /**
     * 数据
     */
    @ApiModelProperty(value = "数据", required = true)
    private T data;

    public CommonResult(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public CommonResult(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}
